home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 11 / Info-Mac_XI_Disc_1.cdr_ / Info-Mac XI Disc 1.cdr / Programs / Science & Math / MacEspresso 1.0 / espresso / main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-10  |  4.3 KB  |  124 lines  |  [TEXT/R*ch]

  1. enum keys {
  2.     KEY_ESPRESSO, KEY_PLA_verify, KEY_check, KEY_contain, KEY_d1merge,
  3.     KEY_disjoint, KEY_dsharp, KEY_echo, KEY_essen, KEY_exact, KEY_expand,
  4.     KEY_gasp, KEY_intersect, KEY_irred, KEY_lexsort, KEY_make_sparse,
  5.     KEY_map, KEY_mapdc, KEY_minterms, KEY_opo, KEY_opoall,
  6.     KEY_pair, KEY_pairall, KEY_primes, KEY_qm, KEY_reduce, KEY_sharp,
  7.     KEY_simplify, KEY_so, KEY_so_both, KEY_stats, KEY_super_gasp, KEY_taut,
  8.     KEY_test, KEY_equiv, KEY_union, KEY_verify, KEY_MANY_ESPRESSO,
  9.     KEY_separate, KEY_xor, KEY_d1merge_in, KEY_fsm, KEY_signature,
  10.     KEY_unknown
  11. };
  12.  
  13. /* Lookup table for program options */
  14. struct {
  15.     char *name;
  16.     enum keys key;
  17.     int num_plas;
  18.     bool needs_offset;
  19.     bool needs_dcset;
  20. } option_table [] = {
  21.     /* ways to minimize functions */
  22.     "ESPRESSO", KEY_ESPRESSO, 1, TRUE, TRUE,    /* must be first */
  23.     "many", KEY_MANY_ESPRESSO, 1, TRUE, TRUE,
  24.     "exact", KEY_exact, 1, TRUE, TRUE,
  25.     "qm", KEY_qm, 1, TRUE, TRUE,
  26.     "single_output", KEY_so, 1, TRUE, TRUE,
  27.     "so", KEY_so, 1, TRUE, TRUE,
  28.     "so_both", KEY_so_both, 1, TRUE, TRUE,
  29.     "simplify", KEY_simplify, 1, FALSE, FALSE,
  30.     "echo", KEY_echo, 1, FALSE, FALSE,
  31.     "signature", KEY_signature, 1, TRUE, TRUE,
  32.  
  33.     /* output phase assignment and assignment of inputs to two-bit decoders */
  34.     "opo", KEY_opo, 1, TRUE, TRUE,
  35.     "opoall", KEY_opoall, 1, TRUE, TRUE,
  36.     "pair", KEY_pair, 1, TRUE, TRUE,
  37.     "pairall", KEY_pairall, 1, TRUE, TRUE,
  38.  
  39.     /* Ways to check covers */
  40.     "check", KEY_check, 1, TRUE, TRUE,
  41.     "stats", KEY_stats, 1, FALSE, FALSE,
  42.     "verify", KEY_verify, 2, FALSE, TRUE,
  43.     "PLAverify", KEY_PLA_verify, 2, FALSE, TRUE,
  44.  
  45.     /* hacks */
  46.     "equiv", KEY_equiv, 1, TRUE, TRUE,
  47.     "map", KEY_map, 1, FALSE, FALSE,
  48.     "mapdc", KEY_mapdc, 1, FALSE, FALSE,
  49.     "fsm", KEY_fsm, 1, FALSE, TRUE,
  50.  
  51.     /* the basic boolean operations on covers */
  52.     "contain", KEY_contain, 1, FALSE, FALSE,
  53.     "d1merge", KEY_d1merge, 1, FALSE, FALSE,
  54.     "d1merge_in", KEY_d1merge_in, 1, FALSE, FALSE,
  55.     "disjoint", KEY_disjoint, 1, TRUE, FALSE,
  56.     "dsharp", KEY_dsharp, 2, FALSE, FALSE,
  57.     "intersect", KEY_intersect, 2, FALSE, FALSE,
  58.     "minterms", KEY_minterms, 1, FALSE, FALSE,
  59.     "primes", KEY_primes, 1, FALSE, TRUE,
  60.     "separate", KEY_separate, 1, TRUE, TRUE,
  61.     "sharp", KEY_sharp, 2, FALSE, FALSE,
  62.     "union", KEY_union, 2, FALSE, FALSE,
  63.     "xor", KEY_xor, 2, TRUE, TRUE,
  64.  
  65.     /* debugging only -- call each step of the espresso algorithm */
  66.     "essen", KEY_essen, 1, FALSE, TRUE,
  67.     "expand", KEY_expand, 1, TRUE, FALSE,
  68.     "gasp", KEY_gasp, 1, TRUE, TRUE,
  69.     "irred", KEY_irred, 1, FALSE, TRUE,
  70.     "make_sparse", KEY_make_sparse, 1, TRUE, TRUE,
  71.     "reduce", KEY_reduce, 1, FALSE, TRUE,
  72.     "taut", KEY_taut, 1, FALSE, FALSE,
  73.     "super_gasp", KEY_super_gasp, 1, TRUE, TRUE,
  74.     "lexsort", KEY_lexsort, 1, FALSE, FALSE,
  75.     "test", KEY_test, 1, TRUE, TRUE,
  76.     0, KEY_unknown, 0, FALSE, FALSE             /* must be last */
  77. };
  78.  
  79.  
  80. struct {
  81.     char *name;
  82.     int value;
  83. } debug_table[] = {
  84.     "", EXPAND + ESSEN + IRRED + REDUCE + SPARSE + GASP + SHARP + MINCOV,
  85.     "compl",   COMPL,  "essen",       ESSEN,
  86.     "expand",  EXPAND, "expand1",     EXPAND1|EXPAND,
  87.     "irred",   IRRED,  "irred1",      IRRED1|IRRED,
  88.     "reduce",  REDUCE, "reduce1",     REDUCE1|REDUCE,
  89.     "mincov",  MINCOV, "mincov1",     MINCOV1|MINCOV,
  90.     "sparse",  SPARSE, "sharp",       SHARP,
  91.     "taut",    TAUT,   "gasp",        GASP,
  92.     "exact",   EXACT,
  93.     0,
  94. };
  95.  
  96.  
  97. struct {
  98.     char *name;
  99.     int *variable;
  100.     int value;
  101. } esp_opt_table[] = {
  102.     "eat", &echo_comments, FALSE,
  103.     "eatdots", &echo_unknown_commands, FALSE,
  104.     "fast", &single_expand, TRUE,
  105.     "kiss", &kiss, TRUE,
  106.     "ness", &remove_essential, FALSE,
  107.     "nirr", &force_irredundant, FALSE,
  108.     "nunwrap", &unwrap_onset, FALSE,
  109.     "onset", &recompute_onset, TRUE,
  110.     "pos", &pos, TRUE,
  111.     "random", &use_random_order, TRUE,
  112.     "strong", &use_super_gasp, TRUE,
  113.     0,
  114. };
  115.  
  116. void    init_runtime(void);
  117. void    runtime(void);
  118. void    getPLA(int opt, int argc, char *argv[], int optio, pPLA *PLA, int out_type);
  119. void    usage(void);
  120. void    backward_compatibility_hack(int *argc, char **argv, int *option, int *out_type);
  121. void    delete_arg(int *argc, register char *argv[], int num);
  122. bool    check_arg(int *argc, register char *argv[], register char *s);
  123. void    subcommands(void);
  124.